import requests
def face_analyze(API_key,API_sercret,image_path):
    """该函数为调用face++ face_analyze接口"""
    base_url = 'https://api-cn.faceplusplus.com/facepp/v3/face/analyze'
    files = {'image_file': (image_path, open(image_path, 'rb'), 'multipart/form-data')}
    Face_tokens='aabbc1194b00d9af8117cb355dbf9f3a'
    payload = {
            'api_key':API_key,
            'api_secret':API_sercret,
            'face_tokens':Face_tokens,
            'return_attributes':'gender,age,smiling,headpose,facequality,blur,eyestatus,emotion,beauty,mouthstatus,eyegaze,skinstatus'
            }
    

    r = requests.post(base_url, params = payload,files = files )
    return r.json()

